home *** CD-ROM | disk | FTP | other *** search
- /*
- * MUBBS misc.c
- *
- * This program source code and it's compiled version is
- * Copyright (c) 1991 N. Hawthorn.
- * This program source code and it's compiled version IS NOT IN THE
- * PUBLIC DOMAIN ! Please read the "COPYRIGHT NOTICE / NH" file for details
- * regarding use of this program source code and it's compiled version.
- *
- *
- * Code to make your life eaiser !
- *
- */
-
- #define INMUBBSMISC
-
- #include "MUBBS Module.h"
-
-
-
- /* these are all the routines that you can call, some of them are to */
- /* be used carefully. See the accompanying documentation before use ! */
- /* Don't worry about the "godoit" stuff here, just see the examples */
-
-
- send() { ProcPtr hh; G->S=0; godoit; }
- print() { ProcPtr hh; G->S=1; godoit; }
- sendtext() { ProcPtr hh; G->S=2; godoit; }
- wait() { ProcPtr hh; G->S=3; godoit; }
- cmd1() { ProcPtr hh; G->S=4; godoit; }
- cmd1noecho(){ ProcPtr hh; G->S=5; godoit; }
- sendnc() { ProcPtr hh; G->S=6; godoit; }
- showline() { ProcPtr hh; G->S=7; godoit; }
- clock() { ProcPtr hh; G->S=8; godoit; }
- portsin() { ProcPtr hh; G->S=9; godoit; }
- passportsin(){ ProcPtr hh; G->S=10; godoit; }
- module() { ProcPtr hh; G->S=11; godoit; }
- gettime() { ProcPtr hh; G->S=12; godoit; }
- switchuser(){ ProcPtr hh; G->S=13; godoit; }
-
- fopen() { ProcPtr hh; G->S=14; godoit; }
- fclose() { ProcPtr hh; G->S=15; godoit; }
- fread() { ProcPtr hh; G->S=16; godoit; }
- fwrite() { ProcPtr hh; G->S=17; godoit; }
- ftell() { ProcPtr hh; G->S=18; godoit; }
- fsetpos() { ProcPtr hh; G->S=19; godoit; }
- fgetpos() { ProcPtr hh; G->S=20; godoit; }
- fseek() { ProcPtr hh; G->S=21; godoit; }
- freopen() { ProcPtr hh; G->S=22; godoit; }
- fputs() { ProcPtr hh; G->S=23; godoit; }
- fputc() { ProcPtr hh; G->S=24; godoit; }
- fgetc() { ProcPtr hh; G->S=25; godoit; }
- fgets() { ProcPtr hh; G->S=26; godoit; }
- fflush() { ProcPtr hh; G->S=27; godoit; }
- fprintf() { ProcPtr hh; G->S=28; godoit; }
- fscanf() { ProcPtr hh; G->S=29; godoit; }
- clearerr() { ProcPtr hh; G->S=30; godoit; }
- scanf() { ProcPtr hh; G->S=31; godoit; }
- sscanf() { ProcPtr hh; G->S=32; godoit; }
- sprintf() { ProcPtr hh; G->S=33; godoit; }
- rewind() { ProcPtr hh; G->S=34; godoit; }
- rename() { ProcPtr hh; G->S=35; godoit; }
- remove() { ProcPtr hh; G->S=36; godoit; }
- ungetc() { ProcPtr hh; G->S=37; godoit; }
- puts() { ProcPtr hh; G->S=38; godoit; }
- perror() { ProcPtr hh; G->S=39; godoit; }
- otheruser() { ProcPtr hh; G->S=40; godoit; }
- mackey() { ProcPtr hh; G->S=41; godoit; }
- loguser() { ProcPtr hh; G->S=42; godoit; }
- printout() { ProcPtr hh; G->S=43; godoit; }
- versionck() { ProcPtr hh; G->S=44; godoit; }
-
-
-
- /* These two routines change string formats from C to Pascal and back
-
- PtoCstr(tstring); where are these located ?? in C or Mac ????
- CtoPstr(tstring); this one returns a pointer ??
-
- */
-
- /* You can use these routines to switch things around if you want, they are */
- /* already written for you ! */
-
-
- removespaces(temp)
- char *temp;
- {
- int len;
- len = strlen(temp) - 1; /* takes out trailing spaces */
- while ((temp[len] == '\x20') && (len > 0)){
- temp[len] = '\0';
- len--;
- }
- }
-
- pStrCopy( p2, p1 )
- char *p2, *p1;
- /* copies a pascal string from p1 to p2 */
- {
- int len;
-
- len = *p2++ = *p1++;
- while (--len>=0) *p2++=*p1++;
- }
-
-
- strtoupper(str1) /* makes a string all uppercase */
- char *str1;
- {
- int i = 0,l;
- l=strlen(str1);
- do {
- str1[i] = toupper(str1[i]);
- } while (++i < l);
- }
-
-
- long strcatc(str,c) /* appends a character to a string */
- char *str,c;
- {
- char n[2];
- n[0]=c;
- n[1]=0;
- strcat(str,n) ;
- }
- /* end of function */
-
- long strtolong(str)
- char *str;
- {
- long n;
- sscanf(str,"%ld",&n) ;
- return(n);
- }
- /* end of function */
-
- longtostr(n,str)
- char *str;
- long n;
- {
- sprintf(str,"%ld",n) ;
- }
- /* end of function */
-
- strtoint(str)
- char *str;
- {
- int n=0;
- sscanf(str,"%d",&n) ;
- return(n);
- }
- /* end of function */
-
- inttostr(n,str)
- char *str;
- int n;
- {
- sprintf(str,"%d",n) ;
- }
- /* end of function */
-
- getdatetime(datetime)
- char *datetime;
- {
- gettime("%m/%d/%y %I:%M:%S %p",datetime); /* gets the date & time */
- }
-
-